import api from "./init";
import { AxiosResponse } from "axios";
import { Result } from "@/types/api-common";
import {Friend,  UpdateFriendRemarkRequest} from "@/types/friend";

/**
 * @author BelovedLYC
 * @description 获取好友列表
 */
export const getFriendList = (): Promise<AxiosResponse<Result<Friend[]>>> => {
  return api.get("/friend/list");
};

/**
 * @author FlanChan
 * @description 更新好友备注
 */
export const updateFriendRemark = (
  request: UpdateFriendRemarkRequest
): Promise<AxiosResponse<Result<void>>> => {
  return api.put("/friend/remark", request);
};

/**
 * @author FlanChan
 * @description 删除好友
 */
export const deleteFriend = (
  friendId: string
): Promise<AxiosResponse<Result<void>>> => {
  return api.delete(`/friend/${friendId}`);
};